Public Class frmKEEPING
    Dim index As Integer = 1

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub frmKEEPING_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Try
            GC.Collect()
            Me.Dispose()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub frmOpenItem_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        PublicFunction.NewFormLoad(Me)
    End Sub

    Private Sub Keyboardcontrol1_UserKeyPressed(ByVal sender As System.Object, ByVal e As VINAPOS.KeyboardClassLibrarySmall.KeyboardEventArgs) Handles Keyboardcontrol1.UserKeyPressed
        Select Case index
            Case 1
                txtCustomerName.Focus()
            Case 2
                txtPercent.Focus()
            Case 3
                txtRemark.Focus()
        End Select
        SendKeys.Send(e.KeyboardKeyPressed)
    End Sub

    Private Sub txtItemName_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCustomerName.Enter
        index = 1
    End Sub

    Private Sub txtPrice_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPercent.Enter
        index = 2
    End Sub
    Private Sub txtRemark_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtRemark.Enter
        index = 3
    End Sub

    Private Sub txtPrice_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPercent.ButtonClick
        PublicVariable.frmCalculator.Top = txtPercent.Top + txtPercent.Height
        PublicVariable.frmCalculator.Left = txtPercent.Left + txtPercent.Width
        If PublicVariable.frmCalculator.ShowDialog = Windows.Forms.DialogResult.OK Then
            txtPercent.Text = String.Format(PublicVariable.NumberFormatString, PublicVariable.frmCalculator.txtResult.Text)
        End If
    End Sub
End Class